* {
    margin: 0;
    font-family: sans-serif;
    padding: 0;
    color: #333;
}

header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 1rem;
    box-shadow: 1px 0 5px #dcdcdc;
}

header a {
    text-decoration: none;
    cursor: pointer;
    color: #333;
    margin-left: 0.2rem;
}

.container {
    width: 80%;
    margin: 0 auto;
    padding: 1rem;
}

.data-wr {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.card {
    width: 16rem;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    background-color: #fefefe;
    overflow: hidden;
    position: relative;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1.5rem;
    align-items: center;
}

.card-img {
    height: 300px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.card-body {
    width: 90%;
    padding: 0.5rem;
    box-sizing: border-box;
}

.card-title {
    font-size: 1.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.5rem;
}

.card-text {
    font-size: 1rem;
}

.card-likes-wrapper {
    position: absolute;
    padding-bottom: 0.5rem;
    padding-right: 0.5rem;
    bottom: 0;
    right: 0;
}

.card .like,
.modal .like {
    font-size: 1.5rem;
    color: #404040;
}

.card .liked,
.modal .like {
    color: crimson;
    font-weight: 600;
}

.bold {
    font-weight: bold;
}

.btn-wr {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: auto;
    gap: 1.5rem;
    margin-top: 1rem;
}

.btn {
    background-color: #404040;
    color: #fefefe;
    padding: 1rem;
    border-radius: 10px;
    border: 2px solid #404040;
}

.btn-primary {
    padding: 0.5rem;
}

.btn-danger {
    background-color: rgb(122, 46, 46);
    padding: 0.5rem;
    border: 2px solid rgb(122, 46, 46);
}

.btn:hover {
    color: #404040;
    background-color: #fefefe;
    border: 2px solid #404040;
}

.btn-danger:hover {
    color: rgb(122, 46, 46);
    background-color: #fefefe;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.modal__content {
    background-color: #fefefe;
    width: 80%;
    height: 80%;
    display: flex;
    flex-direction: row;
    border-radius: 10px;
    position: relative;
    padding: 0;
    overflow: auto;
}

.modal__content img {
    height: 100%;
    width: auto;
    max-width: 60%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.modal__content .card-body {
    overflow: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal .card-likes-wrapper {
    padding-bottom: 0.5rem;
    padding-right: 1rem;
}

/* Form  */
.hidden {
    display: none;
}

.add-cat-form,
.edit-cat-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 10px;
    justify-content: center;
    align-items: center;
    margin: auto;
    max-width: 30rem;
}

input,
textarea {
    border-radius: 5px;
    border: 1px solid #404040;
    padding: 0.2rem;
}

textarea {
    resize: none;
}

/* The Close Button */
.close {
    color: #dcdcdc;
    font-size: 2rem;
    font-weight: bold;
    position: absolute;
    padding-right: 1rem;
    top: 0;
    right: 0;
    padding-top: 1rem;
}

.close:hover,
.close:focus {
    color: #404040;
    text-decoration: none;
    cursor: pointer;
}

/* select  */
.sort {
    margin-bottom: 1rem;
    display: flex;
    justify-content: flex-end;
}

.sort label {
    line-height: 1.5rem;
}

.select {
    display: inline-block;
    font-size: 0.8rem;
    color: #404040;
    line-height: 1.3rem;
    padding: 0.3rem 2rem 0.3rem 0.5rem;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    border: 1px solid #dcdcdc;
    border-radius: 5px;
    appearance: none;
    background-color: #fefefe;
    background-image: url(img/chevron-down-solid.svg), linear-gradient(to bottom, #fefefe 0%, #fefefe 100%);
    background-repeat: no-repeat, repeat;
    background-position: right .7rem top 50%, 0 0;
    background-size: .8rem auto, 100%;
}

.select:hover {
    border-color: #404040;
}

.select:focus {
    border-color: #fefefe;
    box-shadow: 1px 0 5px #dcdcdc;
    outline: none;
}

.select option {
    font-weight: normal;
}

/* Adaptive */

@media (max-width: 1024px) {
    .modal__content .btn-wr {
        flex-direction: column;
    }
}

@media (max-width: 845px) {
    .sort {
        justify-content: center;
    }

    .select {
        display: block;
    }
}

@media (max-width: 810px) {
    .modal__content {
        flex-direction: column;
        padding: 0;
        overflow: auto;
    }

    .modal__content>img {
        max-width: 100%;
        max-height: 60%;
    }

    .modal__content .card-body {
        width: 100%;
    }

    .modal__content .btn-wr {
        flex-direction: row;
    }
}

@media (max-width: 500px) {
    .modal__content .btn-wr {
        flex-direction: column;
    }
}